package com.example.album20;

import android.graphics.drawable.AnimationDrawable;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;


import androidx.appcompat.app.AppCompatActivity;

public class MainActivity3 extends AppCompatActivity {


    private ImageView mImg;
    private AnimationDrawable mAd;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
        mImg = (ImageView) findViewById(R.id.imageView1);
        mImg.setBackgroundResource(R.drawable.my_frameanimation);
        mAd = (AnimationDrawable) MainActivity3.this.mImg.getBackground();
        mAd.start();
    }
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        MusicServer.stop(this);
    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        MusicServer.play(this, R.raw.my_music);
    }
}